package xian.woniuxy.be.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import xian.woniuxy.be.dao.ContactrecordMapper;
import xian.woniuxy.be.dao.custom.CustomContactrecordMapper;
import xian.woniuxy.be.entity.Contactrecord;
import xian.woniuxy.be.service.IContactrecordService;

import java.util.List;

/**
 * @author Gong
 * @time 2022/01/09 00:42:30
 */
@Service
@Transactional
public class ContactrecordServiceImpl implements IContactrecordService {

    @Autowired
    private CustomContactrecordMapper contactrecordMapper;

    @Override
    public void save(Contactrecord contactrecord) {
        contactrecordMapper.insert(contactrecord);
    }

    @Override
    public void delete(int reId) {
        contactrecordMapper.deleteByPrimaryKey(reId);
    }

    @Override
    public void update(Contactrecord contactrecord) {
        contactrecordMapper.updateByPrimaryKey(contactrecord);
    }

    @Override
    public List<Contactrecord> findAll() {
        List<Contactrecord> list = contactrecordMapper.selectByExample(null);
        return list;
    }

    @Override
    public List<Contactrecord> findOne(int cusId) {
        List<Contactrecord> list = contactrecordMapper.selectOne(cusId);
        return list;
    }
}
